<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/6
 * Time: 10:37
 */
if(empty($_POST['username'])){
    echo '用户名为空';
    echo '<br />';
    echo '<a href="index.php">重新输入</a>';
    die;
}else{
    $username = $_POST['username'];
}

if(empty($_POST['password'])){
    echo '密码为空';
    echo '<br />';
    echo '<a href="index.php">重新输入</a>';
    die;
}else{
    $password = $_POST['password'];
}

if ($username=='admin' && $password=='888888'){
    $md5 = md5($username.$password.time());
    setcookie('Token',$md5,time()+24*3600);
    echo '<a href="cookie.php">上传头像</a>';
}else{
    echo '账号或密码错误！';
    echo '<br />';
    echo '<a href="index.php">重新登录</a>';
    die;
}


